package com.xxg.fegin.controller;

import com.xxg.fegin.entity.UserEntity;
import com.xxg.fegin.feginapi.UserInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;


@RestController
@RequestMapping("/fegin")
public class FeginController {


    @Resource
    private UserInterface userInterface;

    @RequestMapping("/findAll")
    public ResponseEntity findAll(@RequestParam(value = "pageSize",required = false) int pageSize,
        @RequestParam(value = "pageNum",required = false)int pageNum) {
            String a = userInterface.findAll(pageSize,pageNum);
          return ResponseEntity.ok(a);
//        return ResponseEntity.ok(restTemplate.getForObject("", List.class));
    }

}
